package com.ktg.web.wms;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ktg.ktgcommon.domain.wms.WmOutsourceIssue;
import com.ktg.ktgcommon.result.R;
import com.ktg.service.WmsOutService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WmsOutController {
    @Resource
    private WmsOutService wmsOutService;

    @PostMapping("/api/wasOut/list")
    public R pageInfo(@RequestParam(defaultValue = "1") Integer pageNo,
                      @RequestParam(defaultValue = "10") Integer pageSize, @RequestParam(value = "WmOutsourceIssue",required = false) WmOutsourceIssue WmOutsourceIssue){
        Page<WmOutsourceIssue> wmOutPage = new Page<>(pageNo, pageSize);
        Page<WmOutsourceIssue> wmOutList = wmsOutService.page(wmOutPage, WmOutsourceIssue);
        if (wmOutList != null) {
            return R.OK(wmOutList);
        }
        return R.FAIL();
    }
}
